package org.ztr.yanai.ai.controller.tool;


import jakarta.annotation.Resource;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @Author: ZhaoTR
 * @Date: Created in 2025/11/4 19:33
 * @Description: 测试不带tool的调用
 * @Version: 1.0
 */
@RestController
@RequestMapping("/ai")
public class NoToolCallingController {
    @Resource
    private ChatModel chatModel;

    /**
     * http://localhost:8013/notoolcall/chat
     *
     * @param msg
     * @return
     */
    @GetMapping("/notoolcall/chat")
    public Flux<String> chat(@RequestParam(name = "msg", defaultValue = "你是谁现在几点") String msg) {
        return chatModel.stream(msg);
    }
}
